1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module shumate.LicenseSh;
26 
27 private import glib.ConstructionException;
28 private import glib.Str;
29 private import glib.c.functions;
30 private import gobject.ObjectG;
31 private import gtk.AccessibleIF;
32 private import gtk.AccessibleT;
33 private import gtk.BuildableIF;
34 private import gtk.BuildableT;
35 private import gtk.ConstraintTargetIF;
36 private import gtk.ConstraintTargetT;
37 private import gtk.Widget;
38 private import shumate.MapSource;
39 private import shumate.c.functions;
40 public  import shumate.c.types;
41 
42 
43 /**
44  * A widget that displays license text.
45  */
46 public class LicenseSh : Widget
47 {
48 	/** the main Gtk struct */
49 	protected ShumateLicense* shumateLicense;
50 
51 	/** Get the main Gtk struct */
52 	public ShumateLicense* getLicenseShStruct(bool transferOwnership = false)
53 	{
54 		if (transferOwnership)
55 			ownedRef = false;
56 		return shumateLicense;
57 	}
58 
59 	/** the main Gtk struct as a void* */
60 	protected override void* getStruct()
61 	{
62 		return cast(void*)shumateLicense;
63 	}
64 
65 	/**
66 	 * Sets our main struct and passes it to the parent class.
67 	 */
68 	public this (ShumateLicense* shumateLicense, bool ownedRef = false)
69 	{
70 		this.shumateLicense = shumateLicense;
71 		super(cast(GtkWidget*)shumateLicense, ownedRef);
72 	}
73 
74 
75 	/** */
76 	public static GType getType()
77 	{
78 		return shumate_license_get_type();
79 	}
80 
81 	/**
82 	 * Creates an instance of #ShumateLicense.
83 	 *
84 	 * Returns: a new #ShumateLicense.
85 	 *
86 	 * Throws: ConstructionException GTK+ fails to create the object.
87 	 */
88 	public this()
89 	{
90 		auto __p = shumate_license_new();
91 
92 		if(__p is null)
93 		{
94 			throw new ConstructionException("null returned by new");
95 		}
96 
97 		this(cast(ShumateLicense*) __p);
98 	}
99 
100 	/** */
101 	public void appendMapSource(MapSource mapSource)
102 	{
103 		shumate_license_append_map_source(shumateLicense, (mapSource is null) ? null : mapSource.getMapSourceStruct());
104 	}
105 
106 	/**
107 	 * Gets the additional license text.
108 	 *
109 	 * Returns: the additional license text
110 	 */
111 	public string getExtraText()
112 	{
113 		return Str.toString(shumate_license_get_extra_text(shumateLicense));
114 	}
115 
116 	/**
117 	 * Get the license's text horizontal alignment.
118 	 *
119 	 * Returns: the license's text horizontal alignment.
120 	 */
121 	public float getXalign()
122 	{
123 		return shumate_license_get_xalign(shumateLicense);
124 	}
125 
126 	/** */
127 	public void prependMapSource(MapSource mapSource)
128 	{
129 		shumate_license_prepend_map_source(shumateLicense, (mapSource is null) ? null : mapSource.getMapSourceStruct());
130 	}
131 
132 	/** */
133 	public void removeMapSource(MapSource mapSource)
134 	{
135 		shumate_license_remove_map_source(shumateLicense, (mapSource is null) ? null : mapSource.getMapSourceStruct());
136 	}
137 
138 	/**
139 	 * Show the additional license text on the map view.  The text will preceed the
140 	 * map's licence when displayed. Use "\n" to separate the lines.
141 	 *
142 	 * Params:
143 	 *     text = the additional license text
144 	 */
145 	public void setExtraText(string text)
146 	{
147 		shumate_license_set_extra_text(shumateLicense, Str.toStringz(text));
148 	}
149 
150 	/**
151 	 * Set the license's text horizontal alignment.
152 	 *
153 	 * Params:
154 	 *     xalign = The license's text horizontal alignment
155 	 */
156 	public void setXalign(float xalign)
157 	{
158 		shumate_license_set_xalign(shumateLicense, xalign);
159 	}
160 }